package com.example.artwindow.domain.po;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @TableName movie_info
 */
@TableName(value ="movie_info")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Movie implements Serializable {
    /**
     * 电影id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 电影名
     */
    private String movieName;

    /**
     * 电影封面
     */
    private String movieCover;

    /**
     * 导演名
     */
    private String directorName;

    /**
     * 编剧名
     */
    private String scriptwriterName;

    /**
     * 演员名
     */
    private String actorsName;

    /**
     * 电影类型
     */
    private String movieGenre;

    /**
     * 电影评分
     */
    private BigDecimal movieScore;

    /**
     * 电影评论数
     */
    private Integer movieComments;

    /**
     * 添加人
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    /**
     * 添加时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateTime;

    /**
     * 上映年份
     */
    private Integer releaseYear;

    /**
     * 有效标识：1正常 0删除
     */
    private Integer mark;

    private String plot;

    private String zone;

    private String lang;

    private String duration;

    private String video;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Movie other = (Movie) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getMovieName() == null ? other.getMovieName() == null : this.getMovieName().equals(other.getMovieName()))
            && (this.getMovieCover() == null ? other.getMovieCover() == null : this.getMovieCover().equals(other.getMovieCover()))
            && (this.getDirectorName() == null ? other.getDirectorName() == null : this.getDirectorName().equals(other.getDirectorName()))
            && (this.getScriptwriterName() == null ? other.getScriptwriterName() == null : this.getScriptwriterName().equals(other.getScriptwriterName()))
            && (this.getActorsName() == null ? other.getActorsName() == null : this.getActorsName().equals(other.getActorsName()))
            && (this.getMovieGenre() == null ? other.getMovieGenre() == null : this.getMovieGenre().equals(other.getMovieGenre()))
            && (this.getMovieScore() == null ? other.getMovieScore() == null : this.getMovieScore().equals(other.getMovieScore()))
            && (this.getMovieComments() == null ? other.getMovieComments() == null : this.getMovieComments().equals(other.getMovieComments()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getMark() == null ? other.getMark() == null : this.getMark().equals(other.getMark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getMovieName() == null) ? 0 : getMovieName().hashCode());
        result = prime * result + ((getMovieCover() == null) ? 0 : getMovieCover().hashCode());
        result = prime * result + ((getDirectorName() == null) ? 0 : getDirectorName().hashCode());
        result = prime * result + ((getScriptwriterName() == null) ? 0 : getScriptwriterName().hashCode());
        result = prime * result + ((getActorsName() == null) ? 0 : getActorsName().hashCode());
        result = prime * result + ((getMovieGenre() == null) ? 0 : getMovieGenre().hashCode());
        result = prime * result + ((getMovieScore() == null) ? 0 : getMovieScore().hashCode());
        result = prime * result + ((getMovieComments() == null) ? 0 : getMovieComments().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getMark() == null) ? 0 : getMark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", movieName=").append(movieName);
        sb.append(", movieCover=").append(movieCover);
        sb.append(", directorName=").append(directorName);
        sb.append(", scriptwriterName=").append(scriptwriterName);
        sb.append(", actorsName=").append(actorsName);
        sb.append(", movieGenre=").append(movieGenre);
        sb.append(", movieScore=").append(movieScore);
        sb.append(", movieComments=").append(movieComments);
        sb.append(", createUser=").append(createUser);
        sb.append(", updateUser=").append(updateUser);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", mark=").append(mark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}